home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
- **
- ** File: SNACCAH.C
- ** Purpose: SNA Client for Windows 95 Custom Action
- ** handler for ACME95 setup.
- ** Notes:
- **
- ****************************************************************************/
-
- #define SNACCAH_C
-
- #include "stdinc.h"
- #include <stdlib.h> /* _MAX_PATH */
- #include <dos.h> /* _dos_getdiskfree() */
- #pragma warning (disable : 4001)
- #include <lm.h>
- #include <winsock.h>
- #include <winbase.h>
- #include <wsipx.h>
- #include <excpt.h>
- #include <lmapibuf.h>
- #include "service.h"
- #include "odbcinst.h"
- #pragma warning (default : 4001)
- #include "setupapi.h"
- #include "cui.h"
- #include "stdtypes.h"
- #include "setupkit.h"
- #include "datadef.h"
- #include "parseca.h"
- #include "snaccacb.h"
- #include "snaccah.h"
- #include "resource.h"
-
-
- /*
- * WINDOW SYSTEM FILES TO REMOVE DURING UNINSTALL
- *
- *
- */
- char WinSysRemovefile[][20] =
- {
- "APPCST32.DLL",
- "asynctrc.dll",
- "DMODAPPC.dll",
- "LUASTR32.dll",
- "FMISTR32.dll",
- "CSVSTR32.dll",
- "SNACIP.dll",
- "SNACLM.dll",
- "snacnw.dll",
- "SNADMOD.dll",
- "snadump.dll",
- "SNAKRNL.dll",
- "SNANCP.dll",
- "snareg.dll",
- "snatrc.dll",
- "snatrcsn.dll",
- "WAPPC32.dll",
- "WCPIC32.dll",
- "WINAPPC.dll",
- "WINCPIC.dll",
- "WINCSV.dll",
- "WINCSV32.dll",
- "WINMGT32.dll",
- "WINRUI.dll",
- "WINRUI32.dll",
- "WINSLI.dll",
- "WINSLI32.dll",
- ""
- };
-
-
-
- /*
- * REGISTRY STRINGS
- *
- * This table of registry entries is used when creating the registry keys
- * which are added to the registry during the custom action setup.
- *
- * DESCRIPTION: The entries of this array consist of:
- * Registry Key, Registry Value, Registry Data
- *
- * The Registry Data is setup during the initialization of this custom
- * procedure.
- *
- * NOTE: When adding additional values an enumerated type must be added
- * to the REGISTRYENTRIES enumerated type in the snaccah.h header
- * file.
- */
- char RegistryEntries[InvalidRegistryEntry][InvalidRegistryInformation][255] =
- { /* Registry Key Registry Value Registry Data */
-
- /* Transport Registry Entry */
- "SOFTWARE\\Microsoft\\SnaBase\\Parameters",
- "Transports",
- "\0",
-
- /* SNA Sponsors Registry Entry */
- "SOFTWARE\\Microsoft\\SnaBase\\Parameters",
- "Sponsors",
- "\0",
-
- /* SNA Domain Registry Entry */
- "SOFTWARE\\Microsoft\\SnaBase\\Parameters",
- "SnaDomain",
- "\0",
-
- /* Windows Type Registry Entry */
- "SOFTWARE\\Microsoft\\SNA Server\\CurrentVersion",
- "ClientType",
- "Windows 95",
-
- /* Windows Type Registry Entry */
- "SOFTWARE\\Microsoft\\SNA Server\\CurrentVersion",
- "SNAVersion",
- "2.11"
-
- } ;
-
-
-
- /*
- * REGISTRY REMOVE STRINGS
- *
- * This table of registry entries is used when creating the registry keys
- * which are added to the registry during the custom action setup.
- *
- * DESCRIPTION: The entries of this array consist of:
- * Registry Key, Registry Value, Registry Data
- *
- * The Registry Data is setup during the initialization of this custom
- * procedure.
- *
- * NOTE: When adding additional values an enumerated type must be added
- * to the REGISTRYREMOVEENTRIES enumerated type in the snaccah.h header
- * file. Caution must be taken for the order of entries in this array.
- * The
- */
- char RegistryRemoveEntries[InvalidRemoveRegistryEntry][InvalidRegistryParam][255] =
- { /* Registry Key Registry Value Registry Data */
-
- /* Parameters Registry Key */
- "SOFTWARE\\Microsoft\\SnaBase",
- "Parameters",
-
- /* SnaBase Registry Key */
- "SOFTWARE\\Microsoft",
- "SnaBase",
-
- /* Setup Registry Key */
- "SOFTWARE\\Microsoft\\SNA Server\\CurrentVersion",
- "Setup",
-
- /* CurrentVersion Registry Key */
- "SOFTWARE\\Microsoft\\SNA Server",
- "CurrentVersion",
-
- /* Sna Server Registry Key */
- "SOFTWARE\\Microsoft",
- "SNA Server",
-
- } ;
-
-
- /*
- * REGISTRY KEYS TO BE INSTALLED
- *
- * This table of booleans values can be used to indicate whether any of the
- *
- */
- BOOL RegistryKeysToInstall[InvalidRegistryEntry] =
- { /* Determines if the Key is to be setup in the registry */
- TRUE,
- TRUE,
- TRUE,
- TRUE,
- TRUE
- } ;
-
-
- /*
- * Error Text for Popup Message Boxes
- */
- char SetupErrors[InvalidErrorType][InvalidPopupStrings][255] =
- { /* Window Title */ /* Error Message */
- "REGISTRATION ERROR", "ERROR - unable to add to the registry!\0",
- "PROTOCOL ERROR", "ERROR - you must specify at least one protocol!\0",
- "DOMAIN NAME ERROR", "ERROR - you must specify a Domain Name!\0",
- "PRIMARY SERVER ERROR", "ERROR - you must specify a Primary Remote SNA Server Name!\0",
- "PLEASE STOP SNA COMPONENTS", "ERROR - you must exit setup and stop all SNA Server Components!\0",
- "SNA COMPONENT RUNNING", "ERROR - One of the SNA Base components "
- "is running, would you like to stop all SNA Base Components?\0",
- "ODBC INSTALLATION ERROR", "Unable to install ODBC Administrator!\0"
- } ;
-
-
-
- /*
- * Help Text for Popup Message Boxes (Windows NT only)
- */
- char SetupHelp[InvalidErrorType][InvalidPopupStrings][500] =
- { /* Window Title */ /* Help Message */
- "CLIENT MODE HELP", "Select Local to connect to an SNA Server on the same network domain or "
- "SNA Server subdomain as your client computer. You will be prompted for "
- "a domain or subdomain name. Select Remote if the SNA Server is not in "
- "the same domain or subdomain as your client computer. You will be prompted"
- " for the computer names of the primary and backup remote servers. Contact "
- "your SNA Server administrator if you need assistance with these options.\0",
- "PROTOCOL HELP", "If your machine is using TCP/IP or SPX/IPX to communicate with SNA Server,"
- " select one of these protocols for best performance. If you are using "
- "NetBEUI, you must select Named Pipes.\0",
- "LOCAL CLIENT HELP", "Provides a place for you to type the name of the local Windows NT network "
- "domain or SNA Server subdomain. Contact your SNA Server administrator if"
- " you do not know the name of your domain.\0",
- "REMOTE CLIENT HELP", "Provides a place for you to type the name of a primary SNA server and a "
- "place for you to type the name of a backup SNA server. Contact you SNA "
- "Server administrator if you do not know the names of the SNA servers.\0"
- } ;
-
-
- /*
- * GLOBAL DATA VARIABLES
- */
-
- BOOL ExitRequested = FALSE ; /* Indicates the user has requested to exit setup */
- BOOL BackRequested = FALSE ; /* Indicates the user has requested to return to the previous dialog */
- BOOL TCPSelected = FALSE ; /* Indicates the user has selected TCP as the transport */
-
- char SnaDomainName[255] ; /* Initially setup as the default domain name from the registry */
- char Sponsors[255] ; /* The sum of sponsors selected separated by a space */
- char Transports[255] ; /* The sum of Transports selected separated by a space, (currently only 1) */
-
- char InstallPath[255]; /* The path to the source setup directory */
- char DestinationPath[255]; /* The path to the destination setup directory */
- char HelpFileNameAndPath[255]; /* The entire path to the help file and help file name */
- char WindowsSystemPath[255]; /* The path to the destination windows\system directory */
-
- BOOL Windows95; /* True = WINDOWS 95 False = WINDOWS NT */
- int InstalledApps = 0; /* The total number of installed applications (ODBC, 3270, 5250, AFTP) */
-
- char ClientInstalledText[] = "The setup program has detected a copy of the NT SNA Client installed "
- "on your computer. Please exit setup and remove the NT Client before installing "
- "the Windows 95 Client for SNA Server.";
-
- HWND hDlg ; /* The handle to the desktop window */
- HINSTANCE hInstance ; /* The instance handle */
-
-
- /*
- ** Purpose:
- ** Custom Action Handler for DetectMinimumHardware action (sample).
- ** Arguments:
- ** pcd : Ptr to class data.
- ** pod : Ptr to object data.
- ** camf : Custom action member function type.
- ** pcamfd: Ptr to custom action member function data
- ** (variable size, depends on camf type).
- ** Returns:
- ** For all but camfInitialize, it returns rcDoDefault. For
- ** camfInitialize, it returns rcFail or rcDoDefault.
- ** Notes:
- ** REVIEW: Should get its message strings and definition of 'minimum'
- ** from the .STF table data, but we will hardcode it here for simplicity.
- **
- ***************************************************************************/
- RC FAR PASCAL DetectMinimumHardware ( PCD pcd, POD pod, CAMF camf,
- PCAMFD pcamfd, SZ szData )
- {
- static BOOL fDetectHardwareInitialized = fFalse;
-
- Unused(pcd);
- Unused(pod);
- Unused(pcamfd);
- Unused(szData);
-
- if (camf == camfInitializeObject)
- {
- /* REVIEW: Replace the sample hardware tests below with your
- * own requirements.
- */
- if (!fDetectHardwareInitialized
- && (GetWindowsMajorVersion() < 3
- || (GetWindowsMajorVersion() == 3
- && GetWindowsMinorVersion() < 10)
- || GetProcessorType() == cpu8086
- || GetProcessorType() == cpu80186
- || GetProcessorType() == cpu80286
- || (GetScreenHeight() < 351 && GetScreenWidth() < 641)))
- {
- fDetectHardwareInitialized = fTrue;
- DoMsgBox(STR_DETECT_MSG, STR_DETECT_TITLE,
- MB_OK | MB_ICONEXCLAMATION);
- return (rcFail);
- }
- fDetectHardwareInitialized = fTrue;
- }
-
- return (rcDoDefault);
- }
-
-
- /*
- * FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
- *
- * PURPOSE: Processes messages for the main window. This function is used to
- * for creating a dummy window which has a new extended window class
- * registered so dialog boxes in Windows NT can have the same look
- * as the Windows 95 dialog boxes.
- *
- * MESSAGES: None
- *
- *
- */
- LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- return (DefWindowProc(hWnd, message, wParam, lParam));
- }
-
-
- /*==========================================================================*
- * FUNCTION: CreateInvisibleWindow(void)
- *
- * PURPOSE: This function creates a parent window with a registered class
- * which can be used as the parent window for dialog boxes.
- *
- * MESSAGES: None
- *
- *==========================================================================*/
- void CreateInvisibleWindow(void)
- {
- hDlg = GetDesktopWindow() ;
- hInstance = (HINSTANCE) GetModuleHandle("SETUPCLI.DLL") ;
-
- /*
- MSG msg ;
- HANDLE hMod;
- FARPROC proc;
- char szAppName[20] = "TestApp" ;
- DWORD LastError ;
- WNDCLASSEX wcex;
- hMod = GetModuleHandle ("USER32");
- proc = GetProcAddress (hMod, "RegisterClassExA");
-
- hInstance = (HINSTANCE) GetModuleHandle("SETUPCLI.DLL") ;
-
- if (hInstance != NULL)
- {
- wcex.style = CS_HREDRAW | CS_VREDRAW;
- wcex.lpfnWndProc = (WNDPROC)WndProc;
- wcex.cbClsExtra = 0;
- wcex.cbWndExtra = 0;
- wcex.hInstance = hInstance;
- wcex.hIcon = 0;
- wcex.hCursor = 0;
- wcex.hbrBackground = 0;
- wcex.lpszMenuName = 0;
- wcex.lpszClassName = szAppName;
-
- wcex.cbSize = sizeof(WNDCLASSEX);
- wcex.hIconSm = 0;
- }
- LastError = RegisterClassEx(&wcex);
- hDlg = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- NULL, NULL, hInstance, NULL);
- ShowWindow(hDlg,SW_HIDE) ;
- while ( PeekMessage(&msg, hDlg, 0, 0xffffffff, PM_REMOVE) )
- {
- DispatchMessage(&msg);
- }
- LastError = GetLastError();
- */
- }
-
-
- /*==========================================================================*
- * Destroy Invisible Window
- *==========================================================================*/
- void DestroyInvisibleWindow(void)
- {
- /* DestroyWindow(hDlg) ; */
- }
-
- #ifndef ISVBUILD
- /*==========================================================================*
- * Initialize the position of a dialog box. NOTE the size of the dialog box
- * must be passed in!
- *==========================================================================*/
- void InstallSNAFontFiles(void)
- {
- int LastError;
- char StrBuf[400];
- char StrBuf2[400];
- char StrBuf3[400];
- static char szFontFile[255] = "";
- /* Determine Windows System Path */
- lstrcpy(StrBuf3, WindowsSystemPath);
- lstrcpy(StrBuf, StrBuf3);
- lstrcpy(StrBuf2, InstallPath);
- lstrcat(StrBuf2, "system\\ltype.ttf");
- lstrcat(StrBuf3, "ltype.ttf");
-
- /* Copy the LTYPE.TTF file to the windows\system directory */
- CopyFileA((LPSTR) StrBuf2, (LPSTR) StrBuf3, TRUE);
-
- lstrcpy(szFontFile, StrBuf);
- lstrcat(szFontFile, "ltype.fot");
- LastError = (BOOL) CreateScalableFontResource(0,
- szFontFile,
- "ltype.ttf",
- StrBuf);
- AddFontResource(szFontFile);
- }
- #endif
-
-
- /*==========================================================================*
- * Initialize the position of a dialog box. NOTE the size of the dialog box
- * must be passed in!
- *==========================================================================*/
- void initDlgPosWnd(HWND hDlg)
- {
- RECT dialogRect;
- int MaxX ;
- int MaxY ;
- int DialogWidth ;
- int DialogHeight ;
-
- GetWindowRect(hDlg, (LPRECT) &dialogRect);
-
- DialogWidth = dialogRect.right - dialogRect.left ;
- DialogHeight = dialogRect.bottom - dialogRect.top ;
-
- MaxX = GetSystemMetrics(SM_CXSCREEN) ;
- MaxY = GetSystemMetrics(SM_CYSCREEN) ;
-
- dialogRect.left = (MaxX - DialogWidth) / 2 ;
- dialogRect.top = (MaxY - DialogHeight) / 2 ;
-
- MoveWindow(hDlg, (int)dialogRect.left, (int)dialogRect.top,
- DialogWidth, DialogHeight, FALSE);
-
- }
-
- /*=========================================================================*
- * DisplayError - generic error display function
- *=========================================================================*/
- void DisplayError(ERRORTYPE ErrorIndex)
- {
- MessageBox(GetActiveWindow(),
- SetupErrors[ErrorIndex][WindowMessage],
- SetupErrors[ErrorIndex][WindowTitle],
- MB_OK|MB_ICONEXCLAMATION);
- }
-
- /*=========================================================================*
- * Display help - generic help display function
- *=========================================================================*/
- void DisplayHelp(HELPTYPE HelpIndex)
- {
- MessageBox(GetActiveWindow(),
- SetupHelp[HelpIndex][WindowMessage],
- SetupHelp[HelpIndex][WindowTitle],
- MB_OK|MB_ICONINFORMATION);
- }
-
-
- /*========================================================================*
- * ExitYesNo Dialog Procedure
- *========================================================================*/
- /*
- * Turn off the warning "xxx: unreferenced formal parameter"
- */
- #pragma warning (disable : 4100)
- BOOL CALLBACK
- ExitYesNoDlg(
- HWND hDlg,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
- {
-
- switch (message)
- {
- case WM_CLOSE:
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case WM_INITDIALOG:
- initDlgPosWnd(hDlg);
- ExitRequested = FALSE ;
- return TRUE ;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_RESUME:
- ExitRequested = FALSE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_EXIT:
- ExitRequested = TRUE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
- break;
- }
- break ;
- }
- return FALSE ;
- }
-
- /*========================================================================*
- * License Dialog Procedure
- *========================================================================*/
- /*
- * Turn off the warning "xxx: unreferenced formal parameter"
- */
- #pragma warning (disable : 4100)
- BOOL CALLBACK
- LicenseDlg(
- HWND hDlg,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
- {
-
- switch (message)
- {
- case WM_CLOSE:
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case WM_INITDIALOG:
- initDlgPosWnd(hDlg);
- ExitRequested = FALSE ;
- return TRUE ;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_CONTINUE:
- ExitRequested = FALSE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_EXIT:
- ExitRequested = TRUE;
- EndDialog(hDlg, 0) ;
- return FALSE ;
- break;
- }
- break ;
- }
- return FALSE ;
- }
-
- /*=========================================================================*
- * ExitYesNo - Exit Yes or No
- *=========================================================================*/
- void ExitYesNoMB(void)
- {
- char szAppName[13] = "EXITYESNO" ;
- if (Windows95)
- {
- lstrcat(szAppName,"EX");
- }
- (void)DialogBox(hInstance,
- szAppName,
- hDlg,
- ExitYesNoDlg) ;
- }
-
- /*=========================================================================*
- * Add to Registry - this function adds a single entry to the registry from
- * values passed in the following parameters:
- *
- * RegistryKey - full path of the registry key
- * RegistryName - name of the registry entry
- * RegistryData - Data to be placed in the registry
- *
- *=========================================================================*/
- int AddRegistryEntry (
- LPSTR RegistryKey,
- LPSTR RegistryName,
- LPSTR RegistryData )
- {
- HKEY hKey ;
- DWORD iDisposition ;
- int DataLength = 0 ;
-
- DataLength += lstrlen(RegistryData) ;
- RegCreateKeyEx(HKEY_LOCAL_MACHINE,
- RegistryKey,
- 0,
- NULL,
- REG_OPTION_NON_VOLATILE,
- KEY_WRITE,
- NULL,
- &hKey,
- (LPDWORD) &iDisposition) ;
- RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- RegistryKey,
- 0,
- KEY_WRITE,
- &hKey) ;
- DataLength++;
- if (ERROR_SUCCESS !=
- RegSetValueEx(hKey,
- RegistryName,
- 0,
- REG_SZ,
- RegistryData,
- DataLength)) DisplayError(RegistrationError) ;
- RegCloseKey(hKey) ;
- return (0) ;
- }
-
- /*=========================================================================*
- * Update Registry - This function updates the registry with all new SNA
- * client entries.
- */
- int UpdateRegistry(void)
- {
- REGISTRYENTRIES RegistryEntry;
-
- for (RegistryEntry=TransportRegistry; RegistryEntry<InvalidRegistryEntry; RegistryEntry++)
- {
- if (RegistryKeysToInstall[RegistryEntry])
- AddRegistryEntry ( RegistryEntries[RegistryEntry][RegistryKey],
- RegistryEntries[RegistryEntry][RegistryValue],
- RegistryEntries[RegistryEntry][RegistryData] );
- }
- return 0 ;
- }
-
- /*=========================================================================*
- * Remove Registry - This function removes all registry entries created by
- * this DLL.
- */
- void RemoveRegistry(void)
- {
- HKEY hKey ;
- REGISTRYREMOVEENTRIES RegistryRemoveEntry;
- for (RegistryRemoveEntry=SystemSnaParameters;
- RegistryRemoveEntry<InvalidRemoveRegistryEntry;
- RegistryRemoveEntry++)
- {
- RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- RegistryRemoveEntries[RegistryRemoveEntry]
- [RegistryRemoveKey],
- 0,
- KEY_WRITE,
- &hKey) ;
- RegDeleteKey(hKey, RegistryRemoveEntries[RegistryRemoveEntry]
- [RegistryRemoveSubKey]);
- RegCloseKey(hKey) ;
- }
- }
-
-
-
- /*=========================================================================*
- * Remove Ini and Trace Files - This function removes .ini and trace files
- * created by the Client.
- *
- */
- BOOL RemoveIniAndTraceFiles(void)
- {
- char TraceFiles[300] = "";
- WIN32_FIND_DATA CurrentFile;
- HANDLE FileHandle;
- char FileNameAndPath[MAX_PATH];
- int i;
-
- /*
- * Remove all Trace files (.trc)
- */
- lstrcpy(TraceFiles, DestinationPath);
- lstrcat(TraceFiles, "traces\\*.trc");
- while (INVALID_HANDLE_VALUE !=
- (FileHandle = FindFirstFile(TraceFiles, (LPWIN32_FIND_DATA) &CurrentFile)))
- {
- strcpy(FileNameAndPath, DestinationPath);
- strcat(FileNameAndPath, "traces\\");
- strcat(FileNameAndPath, CurrentFile.cFileName);
- if (!DeleteFile(FileNameAndPath))
- {
- FindClose(FileHandle);
- break;
- }
- FindClose(FileHandle);
- }
-
- /*
- * Remove applet ini file (RUMBA.INI)
- */
- strcpy(FileNameAndPath, DestinationPath);
- strcat(FileNameAndPath, "system\\");
- strcat(FileNameAndPath, "RUMBA.INI");
- DeleteFile(FileNameAndPath);
-
- /*
- * Remove applet ini file (WIN5250.INI)
- */
- strcpy(FileNameAndPath, DestinationPath);
- strcat(FileNameAndPath, "system\\");
- strcat(FileNameAndPath, "WIN5250.INI");
- DeleteFile(FileNameAndPath);
-
- /*
- * Remove SNA dump file (SNADUMP.LOG)
- */
- strcpy(FileNameAndPath, DestinationPath);
- strcat(FileNameAndPath, "traces\\");
- strcat(FileNameAndPath, "SNADUMP.LOG");
- DeleteFile(FileNameAndPath);
-
- /*
- * Remove windows\system files
- */
- for (i = 0; strcmp(WinSysRemovefile[i],""); i++)
- {
- strcpy(FileNameAndPath, WindowsSystemPath);
- strcat(FileNameAndPath, WinSysRemovefile[i]);
- DeleteFile(FileNameAndPath);
- }
-
- return TRUE;
- }
-
-
-
- /*========================================================================*
- * Get the local system parameters.
- *========================================================================*/
- BOOL
- SetupSystemParameters(PCD pcd, POD pod, CAMF camf,
- PCAMFD pcamfd, SZ szData )
- {
- HKEY hKey ;
- char HelpFileName[] = "SETUPCLI.HLP";
- LPSTR DomainKeyNT = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\0";
- LPSTR DomainSubKeyNT = "CachePrimaryDomain\0";
- LPSTR DomainKeyWin95 = "SYSTEM\\CurrentControlSet\\Services\\MSNP32\\NetworkProvider\0";
- LPSTR DomainSubKeyWin95 = "AuthenticatingAgent\0";
- LPSTR DomainKey;
- LPSTR DomainSubKey;
- LPSTR WindowsKeyNT = "SOFTWARE\\Microsoft\\Windows NT\0";
- LPSTR WindowsKeyWin95 = "SOFTWARE\\Microsoft\\Windows\0";
- char szBuffer[256] ;
- BOOL ErrorReturn = TRUE ;
- DWORD dType ;
- DWORD dSize = 255 ;
-
- /*
- * Determine the installation path and destination path
- */
- lstrcpy(InstallPath, pcd->rgchStfSrcDir);
- lstrcpy(DestinationPath, pod->szDstDir);
- lstrcpy(HelpFileNameAndPath, InstallPath);
- lstrcat(HelpFileNameAndPath, HelpFileName);
- lstrcpy(WindowsSystemPath, pcd->rgchStfSys16Dir);
- lstrcpy(WindowsSystemPath, pcd->rgchStfSysDir);
-
- /*
- * Determine Windows Version Currently Installed
- */
- if (0 > (int) GetVersion())
- {
- Windows95 = TRUE;
- DomainKey = DomainKeyWin95 ;
- DomainSubKey = DomainSubKeyWin95;
- RegCloseKey(hKey) ;
- }
- else
- {
- Windows95 = FALSE ;
- DomainKey = DomainKeyNT ;
- DomainSubKey = DomainSubKeyNT;
- RegCloseKey(hKey) ;
- }
-
- /*
- * Locate default domain name from registry
- */
- RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- DomainKey,
- 0,
- KEY_READ,
- &hKey) ;
- if (ERROR_SUCCESS == RegQueryValueEx(hKey,
- DomainSubKey,
- 0,
- (LPDWORD) &dType,
- szBuffer,
- (LPDWORD) &dSize))
- {
- lstrcpy(SnaDomainName, szBuffer) ;
- }
- RegCloseKey(hKey) ;
- return ErrorReturn;
- }
-
-
- /*========================================================================*
- * Check to see if the NT SNA Client is installed
- *========================================================================*/
- BOOL
- CheckForNTClient(void)
- {
- HKEY hKey ;
- BOOL NTClientInstalled = FALSE;
- LPSTR NTClientKey = "SYSTEM\\CurrentControlSet\\Services\\SnaBase\\Linkage";
- LPSTR NTClientSubKey = "OtherDependencies";
- char szBuffer[256] ;
- DWORD dType ;
- DWORD dSize = 255 ;
-
-
- /*
- * Check to see if the NT Client is installed
- */
- RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- NTClientKey,
- 0,
- KEY_READ,
- &hKey);
- if (ERROR_SUCCESS == RegQueryValueEx(hKey,
- NTClientSubKey,
- 0,
- (LPDWORD) &dType,
- szBuffer,
- (LPDWORD) &dSize))
- {
- NTClientInstalled = TRUE;
- }
-
- RegCloseKey(hKey);
- return NTClientInstalled;
- }
-
-
- /*========================================================================*
- * Get Installed Protocols. Currently only the following are detected:
- * Microsoft\\ Networking
- * Novell Networking (IPX/SPX)
- * TCPIP Networking
- *========================================================================*/
- void
- GetInstalledProtocols(BOOL *MSFT_protocol,
- BOOL *NOVELL_protocol,
- BOOL *TCPIP_protocol)
- {
- HINSTANCE hLib;
- *MSFT_protocol = TRUE ;
- *NOVELL_protocol = TRUE ;
- *TCPIP_protocol = TRUE ;
-
- /*
- * We'll do step-by-step checks for each NOS, starting with
- * Lan Manager, followed by Netware, etc.
- */
-
- /*
- * Netware...
- */
- {
- DWORD dwRc;
- WSADATA wsaData = {0};
- SOCKET sSocket = INVALID_SOCKET;
- FARPROC SockProc = NULL;
- FARPROC pfnProc = NULL;
-
-
- if ( (( hLib = LoadLibrary( NWDLL )) == NULL )
-
- || (( pfnProc = GetProcAddress( hLib, NWFUNC )) == NULL )
-
- || (( dwRc = (*pfnProc)( MAKEWORD( WINSOCKET_MAJOR,
- WINSOCKET_MINOR ),
- &wsaData )) != 0 )
- )
- {
- *NOVELL_protocol = FALSE;
- }
- else if (hLib) {
-
- if (pfnProc && !dwRc) { /* try to open an IPX socket */
-
- if (( SockProc = GetProcAddress( hLib, "socket" )) != NULL ) {
-
- if (( sSocket = (*SockProc)( AF_NS, SOCK_DGRAM, NSPROTO_IPX )) == INVALID_SOCKET ) {
- *NOVELL_protocol = FALSE;
-
- } else {
- if (( SockProc = GetProcAddress( hLib, "closesocket" )) != NULL ) {
- (*SockProc)( sSocket );
- }
- }
- }
- }
- FreeLibrary( hLib );
- hLib = NULL;
- }
- }
-
- /*
- * TCP/IP...
- */
- {
- DWORD dwRc;
- WSADATA wsaData = {0};
- SOCKET sSocket = INVALID_SOCKET;
- FARPROC SockProc = NULL;
- FARPROC pfnProc = NULL;
-
-
- if ( (( hLib = LoadLibrary( IPDLL )) == NULL )
-
- || (( pfnProc = GetProcAddress( hLib, IPFUNC )) == NULL )
-
- || (( dwRc = (*pfnProc)( MAKEWORD( WINSOCKET_MAJOR,
- WINSOCKET_MINOR ),
- &wsaData )) != 0 )
- )
- {
- *TCPIP_protocol = FALSE;
- }
- else if (hLib) {
-
- if (pfnProc && !dwRc) { /* try to open an IP socket */
-
- if (( SockProc = GetProcAddress( hLib, "socket" )) != NULL ) {
-
- if (( sSocket = (*SockProc)( PF_INET, SOCK_DGRAM, 0 )) == INVALID_SOCKET ) {
- *TCPIP_protocol = FALSE;
-
- } else {
- if (( SockProc = GetProcAddress( hLib, "closesocket" )) != NULL ) {
- (*SockProc)( sSocket );
- }
- }
- }
- }
- FreeLibrary( hLib );
- hLib = NULL;
- }
- }
-
- }
-
- /*========================================================================*
- * Client Protocol Dialog Box Procedure
- *========================================================================*/
- /*
- * Turn off the warning "xxx: unreferenced formal parameter"
- */
- #pragma warning (disable : 4100)
- BOOL CALLBACK
- ClientProtocolsDlg(
- HWND hDlg,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
- {
- static BOOL MSFT_protocol = TRUE ;
- static BOOL NOVELL_protocol = TRUE ;
- static BOOL TCPIP_protocol = TRUE ;
- char szTCPDLL[] = "snacip.dll \0" ;
- char szNOVELLDLL[] = "snacnw.dll \0" ;
- char szMSFTDLL[] = "snaclm.dll \0" ;
- int DataLength = 0 ;
-
- static const DWORD ClientProtocolsHelpIDs [] =
- {
- IDC_MSFT, IDC_MSFT,
- IDC_NOVELL, IDC_NOVELL,
- IDC_TCPIP, IDC_TCPIP,
- IDC_CONTINUE, IDC_CONTINUE,
- IDC_EXIT, IDC_EXIT,
- 0, 0
- };
-
- switch (message)
- {
- case WM_HELP:
- {
- LPHELPINFO lphi;
- lphi = (LPHELPINFO)lParam;
- if (lphi->iContextType == HELPINFO_WINDOW)
- {
- WinHelp(lphi->hItemHandle,
- HelpFileNameAndPath,
- HELP_WM_HELP,
- (DWORD) (LPVOID) ClientProtocolsHelpIDs);
- }
- return TRUE ;
- }
-
- case WM_CLOSE:
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case WM_INITDIALOG:
- {
- initDlgPosWnd(hDlg);
- GetInstalledProtocols(&MSFT_protocol,
- &NOVELL_protocol,
- &TCPIP_protocol ) ;
- /*
- * Enable appropriate check boxes
- */
- if (!MSFT_protocol)
- EnableWindow(GetDlgItem(hDlg, IDC_MSFT), FALSE) ;
- if (!NOVELL_protocol)
- EnableWindow(GetDlgItem(hDlg, IDC_NOVELL), FALSE) ;
- if (!TCPIP_protocol)
- EnableWindow(GetDlgItem(hDlg, IDC_TCPIP), FALSE) ;
- /*
- * Set up the default protocol
- */
- if (TCPIP_protocol)
- CheckDlgButton(hDlg, IDC_TCPIP, 1) ;
- else if (MSFT_protocol)
- CheckDlgButton(hDlg, IDC_MSFT, 1) ;
- else if (NOVELL_protocol)
- CheckDlgButton(hDlg, IDC_NOVELL, 1) ;
- return TRUE ;
- }
-
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case IDC_CONTINUE:
- if (!(IsDlgButtonChecked(hDlg, IDC_MSFT) ||
- IsDlgButtonChecked(hDlg, IDC_TCPIP) ||
- IsDlgButtonChecked(hDlg, IDC_NOVELL)) )
- {
- DisplayError(ProtocolError) ;
- return TRUE ;
- }
- if (IsDlgButtonChecked(hDlg, IDC_MSFT))
- {
- DataLength += lstrlen(szMSFTDLL) ;
- lstrcat(RegistryEntries[TransportRegistry]
- [RegistryData],szMSFTDLL) ;
- }
- if (IsDlgButtonChecked(hDlg, IDC_TCPIP))
- {
- TCPSelected = TRUE;
- DataLength += lstrlen(szTCPDLL) ;
- lstrcat(RegistryEntries[TransportRegistry]
- [RegistryData],szTCPDLL);
- }
- if (IsDlgButtonChecked(hDlg, IDC_NOVELL))
- {
- DataLength += lstrlen(szNOVELLDLL) ;
- lstrcat(RegistryEntries[TransportRegistry]
- [RegistryData],szNOVELLDLL) ;
- }
- /* Indicate the Protocols Registry Key should be setup */
- RegistryKeysToInstall[TransportRegistry] = TRUE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_HELPT:
- DisplayHelp(ProtocolHelp) ;
- return TRUE ;
-
- case IDC_EXIT:
- ExitYesNoMB() ;
- if (ExitRequested) EndDialog(hDlg, 0) ;
- return TRUE ;
-
- break ;
- }
- }
- break ;
- }
- return FALSE ;
- }
-
-
- /*========================================================================*
- * Remote Client Dialog Box Procedure
- *========================================================================*/
- /*
- * Turn off the warning "xxx: unreferenced formal parameter"
- */
- #pragma warning (disable : 4100)
- BOOL CALLBACK
- RemoteClientDlg(
- HWND hDlg,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
- {
- char TempString[255] = "" ;
- int DataLength = 0 ;
-
- static const DWORD RemoteClientHelpIDs [] =
- {
- IDC_PRIMARY, IDC_PRIMARY,
- IDC_BACKUP, IDC_BACKUP,
- IDC_CONTINUE, IDC_CONTINUE,
- IDC_EXIT, IDC_EXIT,
- IDC_BACK, IDC_BACK,
- 0, 0
- };
-
- switch (message)
- {
- case WM_HELP:
- {
- LPHELPINFO lphi;
-
- lphi = (LPHELPINFO)lParam;
- if (lphi->iContextType == HELPINFO_WINDOW)
- {
- WinHelp(lphi->hItemHandle,
- HelpFileNameAndPath,
- HELP_WM_HELP,
- (DWORD) (LPVOID) RemoteClientHelpIDs);
- }
- return TRUE ;
- }
-
- case WM_CLOSE:
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case WM_INITDIALOG:
- initDlgPosWnd(hDlg);
- BackRequested = FALSE ;
- return TRUE ;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_CONTINUE:
- if (!GetDlgItemText(hDlg,
- IDC_PRIMARY,
- RegistryEntries[SponsorRegistry]
- [RegistryData],
- 255))
- {
- DisplayError(PrimaryServerError) ;
- return TRUE ;
- }
- if (GetDlgItemText(hDlg,
- IDC_BACKUP,
- TempString,
- 255))
- {
- lstrcat(RegistryEntries[SponsorRegistry][RegistryData], " \0") ;
- lstrcat(RegistryEntries[SponsorRegistry][RegistryData], TempString) ;
- }
- RegistryKeysToInstall[SponsorRegistry] = TRUE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_HELPT:
- DisplayHelp(RemoteClientHelp) ;
- return TRUE ;
-
- case IDC_EXIT:
- ExitYesNoMB() ;
- if (ExitRequested) EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_BACK:
- BackRequested = TRUE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- break ;
- }
- break ;
- }
- return FALSE ;
- }
-
- /*========================================================================*
- * Local Client Dialog Box Procedure
- *========================================================================*/
- /*
- * Turn off the warning "xxx: unreferenced formal parameter"
- */
- #pragma warning (disable : 4100)
- BOOL CALLBACK
- LocalClientDlg(
- HWND hDlg,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
- {
- int DataLength = 0 ;
-
- static const DWORD LocalClientHelpIDs [] =
- {
- IDC_DOMAIN, IDC_DOMAIN,
- IDC_CONTINUE, IDC_CONTINUE,
- IDC_EXIT, IDC_EXIT,
- IDC_BACK, IDC_BACK,
- 0, 0
- };
-
- switch (message)
- {
- case WM_HELP:
- {
- LPHELPINFO lphi;
-
- lphi = (LPHELPINFO)lParam;
- if (lphi->iContextType == HELPINFO_WINDOW)
- {
- WinHelp(lphi->hItemHandle,
- HelpFileNameAndPath,
- HELP_WM_HELP,
- (DWORD) (LPVOID) LocalClientHelpIDs);
- }
- return TRUE ;
- }
-
- case WM_CLOSE:
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case WM_INITDIALOG:
- initDlgPosWnd(hDlg);
- SetDlgItemText(hDlg,
- IDC_DOMAIN,
- SnaDomainName) ;
- initDlgPosWnd(hDlg);
- BackRequested = FALSE ;
- return TRUE ;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_CONTINUE:
- if (!GetDlgItemText(hDlg,
- IDC_DOMAIN,
- RegistryEntries[SnaDomainRegistry]
- [RegistryData],
- 255) )
- {
- DisplayError(DomainNameError);
- return TRUE ;
- }
- RegistryKeysToInstall[SnaDomainRegistry] = TRUE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_HELPT:
- DisplayHelp(LocalClientHelp) ;
- return TRUE ;
-
- case IDC_EXIT:
- ExitYesNoMB() ;
- if (ExitRequested)
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_BACK:
- BackRequested = TRUE ;
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- break ;
- }
- break ;
- }
- return FALSE ;
- }
-
- /*========================================================================*
- * Client Mode Dialog Box Procedure
- *========================================================================*/
- /*
- * Turn off the warning "xxx: unreferenced formal parameter"
- */
- #pragma warning (disable : 4100)
- BOOL CALLBACK
- ClientModeDlg(
- HWND hDlg,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
- {
- LPSTR RegistryKey = "SOFTWARE\\Microsoft\\SnaBase\0";
- char RegistryData[255] = "" ;
- LPSTR ClientModeKey = "ObjectName" ;
- char szLocal[] = "LocalSystem\0" ;
- char szRemote[] = "RemoteSystem\0" ;
- int DataLength = 0 ;
- DWORD LastError ;
-
- static const DWORD ClientModeHelpIDs [] =
- {
- IDC_LOCAL, IDC_LOCAL,
- IDC_REMOTE, IDC_REMOTE,
- IDC_CONTINUE, IDC_CONTINUE,
- IDC_EXIT, IDC_EXIT,
- 0, 0
- };
-
- static char szLocalClient[50] = "LocalClient" ;
- static char szRemoteClient[50] = "RemoteClient" ;
-
- switch (message)
- {
- case WM_HELP:
- {
- LPHELPINFO lphi;
- lphi = (LPHELPINFO)lParam;
- if (lphi->iContextType == HELPINFO_WINDOW)
- {
- WinHelp(lphi->hItemHandle,
- HelpFileNameAndPath,
- HELP_WM_HELP,
- (DWORD) (LPVOID) ClientModeHelpIDs);
- }
- return TRUE ;
- }
-
- case WM_CLOSE:
- EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case WM_INITDIALOG:
- initDlgPosWnd(hDlg);
- if (TCPSelected)
- CheckDlgButton(hDlg, IDC_REMOTE, 1) ;
- else
- CheckDlgButton(hDlg, IDC_LOCAL, 1) ;
- if (Windows95)
- {
- lstrcat(szRemoteClient,"EX");
- lstrcat(szLocalClient,"EX");
- }
- return TRUE ;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_CONTINUE:
- if (IsDlgButtonChecked(hDlg, IDC_REMOTE))
- {
- DataLength += lstrlen(szRemote) ;
- lstrcat(RegistryData, szRemote) ;
- }
- else
- {
- DataLength += lstrlen(szLocal) ;
- lstrcat(RegistryData, szLocal) ;
- }
- ShowWindow(hDlg, SW_HIDE);
- if (IsDlgButtonChecked(hDlg, IDC_REMOTE))
- {
- (void)DialogBox(hInstance,
- szRemoteClient,
- hDlg,
- RemoteClientDlg) ;
- }
- else
- {
- (void)DialogBox(hInstance,
- szLocalClient,
- hDlg,
- LocalClientDlg) ;
- }
- LastError = GetLastError() ;
- if (!BackRequested) EndDialog(hDlg, 0) ;
- return TRUE ;
-
- case IDC_HELPT:
- DisplayHelp(ClientModeHelp) ;
- return TRUE ;
-
- case IDC_EXIT:
- ExitYesNoMB() ;
- if (ExitRequested) EndDialog(hDlg, 0) ;
- return TRUE ;
-
- }
- break ;
- }
- return FALSE ;
- }
-
-
-
- #ifndef ISVBUILD
- /*
- ** Purpose:
- ** Custom Action Handler for Count Installed Apps.
- ** Arguments:
- ** pcd : Ptr to class data.
- ** pod : Ptr to object data.
- ** camf : Custom action member function type.
- ** pcamfd: Ptr to custom action member function data
- ** (variable size, depends on camf type).
- ** Returns:
- ** For all but camfInitialize, it returns rcDoDefault. For
- ** camfInitialize, it returns rcFail or rcDoDefault.
- ** Notes:
- ** REVIEW: Should get its message strings and definition of 'minimum'
- ** from the .STF table data, but we will hardcode it here for simplicity.
- **
- ***************************************************************************/
- RC FAR PASCAL CountInstalledApps ( PCD pcd, POD pod, CAMF camf,
- PCAMFD pcamfd, SZ szData )
- {
- Unused(pcd);
- Unused(pcamfd);
- Unused(szData);
- if (pod->ois == oisToBeInstalled)
- {
- InstalledApps++;
- }
- return (rcDoDefault);
- }
-
-
- /*
- ** Purpose:
- ** Custom Action Handler for installing ODBC.
- ** Arguments:
- ** pcd : Ptr to class data.
- ** pod : Ptr to object data.
- ** camf : Custom action member function type.
- ** pcamfd: Ptr to custom action member function data
- ** (variable size, depends on camf type).
- ** Returns:
- ** For all but camfInitialize, it returns rcDoDefault. For
- ** camfInitialize, it returns rcFail or rcDoDefault.
- ** Notes:
- ** REVIEW: Should get its message strings and definition of 'minimum'
- ** from the .STF table data, but we will hardcode it here for simplicity.
- **
- ***************************************************************************/
- RC FAR PASCAL InstallODBCFiles ( PCD pcd, POD pod, CAMF camf,
- PCAMFD pcamfd, SZ szData )
- {
- static char szApp1Name[50] = "ClientLicenseDialog" ;
- static BOOL ODBCFilesInstalled = FALSE ;
- HINSTANCE hLib = NULL;
- BOOL fStatus = FALSE;
- CHAR szODBCPath[300];
- CHAR szODBCDll[300];
- CHAR szODBCInf[300];
- CHAR szODBCApp[300] = "StarSQL 32";
-
- Unused(pod);
- Unused(pcamfd);
- Unused(szData);
-
- if (!ODBCFilesInstalled)
- {
- switch (camf)
- {
- case camfDoNonVisualMods:
- {
- if (((pcd->simSetupMode == simFloppyM) ||
- (pcd->simSetupMode == simMaintM)) &&
- (pod->ois == oisToBeInstalled))
- {
- lstrcpy( szODBCDll, pcd->rgchStfSrcDir );
- lstrcat( szODBCDll, "system\\odbc\\odbccp32.dll");
- lstrcpy( szODBCInf, pcd->rgchStfSrcDir );
- lstrcat( szODBCInf, "system\\odbc\\ODBC.INF");
- lstrcpy( szODBCPath, pcd->rgchStfSrcDir );
- lstrcat( szODBCPath, "system\\odbc\\");
-
- __try
- {
- fStatus = SQLInstallODBC(hDlg,
- szODBCInf,
- szODBCPath,
- szODBCApp);
- ODBCFilesInstalled = TRUE;
- }
- __except (EXCEPTION_EXECUTE_HANDLER)
- {
- ODBCFilesInstalled = FALSE;
- return (rcDoDefault);
- }
- }
- }
- }
- }
- return (rcDoDefault);
- }
-
- #endif
- /*
- ** Purpose:
- ** Custom Action Handler for SetClientParameters custom action.
- ** Arguments:
- ** pcd : Ptr to class data.
- ** pod : Ptr to object data.
- ** camf : Custom action member function type.
- ** pcamfd: Ptr to custom action member function data
- ** (variable size, depends on camf type).
- ** Returns:
- ** For all but camfInitialize, it returns rcDoDefault. For
- ** camfInitialize, it returns rcFail or rcDoDefault.
- ** Notes:
- ** REVIEW: Should get its message strings and definition of 'minimum'
- ** from the .STF table data, but we will hardcode it here for simplicity.
- **
- ***************************************************************************/
- RC FAR PASCAL SetClientParameters ( PCD pcd, POD pod, CAMF camf,
- PCAMFD pcamfd, SZ szData )
- {
- static char szApp1Name[50] = "ClientProtocols" ;
- static char szApp2Name[50] = "ClientMode" ;
- static BOOL Beenhere = FALSE ;
- static char szLicenseDlg[20] ;
- DWORD LastError ;
- Unused(pcd);
- Unused(pod);
- Unused(pcamfd);
- Unused(szData);
-
- if( FindWindow( "SnaBase", NULL) && !ExitRequested)
- {
- if (!Beenhere)
- {
- DisplayError(SnaBaseRunningError);
- }
- Beenhere = TRUE;
- return (rcCancel);
- }
-
-
- switch (camf)
- {
- case camfInitializeObject:
- {
- if ((CheckForNTClient()) && (!Beenhere))
- {
- MessageBox(GetActiveWindow(),
- ClientInstalledText,
- "NT Client Installed",
- MB_OK|MB_ICONEXCLAMATION);
- Beenhere = TRUE;
- return (rcCancel) ;
- }
- }
-
- case camfAddBillBoards:
- {
- if (((pcd->simSetupMode == simFloppyM) ||
- (pcd->simSetupMode == simMaintM)) &&
- (pod->ois == oisToBeInstalled))
- {
- CreateInvisibleWindow();
- #ifndef ISVBUILD
- if ((InstalledApps > 0))
- lstrcpy(szLicenseDlg,"APPLETDLG");
- else
- lstrcpy(szLicenseDlg,"NOAPPLETDLG");
- LastError = DialogBox(hInstance,
- szLicenseDlg,
- hDlg,
- LicenseDlg);
- if (ExitRequested) return (rcCancel);
- #endif
- }
-
- if ((pcd->simSetupMode == simFloppyM) &&
- (pod->ois == oisToBeInstalled))
- {
- SetupSystemParameters(pcd, pod, camf, pcamfd, szData);
- if (Windows95)
- {
- lstrcat(szApp1Name,"EX");
- lstrcat(szApp2Name,"EX");
- }
- LastError = DialogBox(hInstance,
- szApp1Name,
- hDlg,
- ClientProtocolsDlg) ;
- LastError = GetLastError();
- if (!ExitRequested)
- (void)DialogBox(hInstance,
- szApp2Name,
- hDlg,
- ClientModeDlg) ;
- UpdateRegistry();
- DestroyInvisibleWindow();
- }
- break;
- }
-
- case camfFinalizeObject:
- {
- if (pcd->simSetupMode == simMaintDeleteM)
- {
- SetupSystemParameters(pcd, pod, camf, pcamfd, szData);
- RemoveRegistry();
- RemoveIniAndTraceFiles();
- }
- break;
- }
-
- case camfPostInstall:
- {
- #ifndef ISVBUILD
-
- if (pcd->simSetupMode == simFloppyM)
- {
- InstallSNAFontFiles();
- }
- #endif
- if (pcd->simSetupMode == simMaintDeleteM)
- {
- SetupSystemParameters(pcd, pod, camf, pcamfd, szData);
- RemoveRegistry();
- }
- break;
- }
- }
-
- if (ExitRequested)
- {
- RemoveRegistry() ;
- return (rcCancel) ;
- }
-
- return (rcDoDefault);
- }
-